home *** CD-ROM | disk | FTP | other *** search
/ FM Towns: Free Software Collection 9 / FM Towns Free Software Collection 9.iso / t_os / shell / igo / gosource / mdtitle.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-16  |  4.8 KB  |  172 lines

  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4. #include <winb.h>
  5. #include <te.h>
  6. #include <fntb.h>
  7. #include <gui.h>
  8. #include "igo.h"
  9. #include "banx.h"
  10. #include "kifuctrl.h"
  11. #include "kiffile.h"
  12. #include "title.h"
  13.  
  14. int    dialogId_title = -1 ;
  15. int    messageId_title[24] = -1 ;
  16. int    blacknameId = -1 ;
  17. int    whitenameId = -1 ;
  18. int    numboxId[12] = -1 ;
  19. int    dbId[2] = -1 ;
  20. int    placeId = -1 ;
  21. int    listMenuId[3] = -1 ;
  22. /*    initDataMITITLE:dbId[0]:MJ_DBUTTONL40の呼び出し関数    */
  23. int    igo_titleset(kobj, messId, argc, pev, trigger)
  24. int        kobj ;
  25. int        messId ;
  26. int        argc ;
  27. EVENT    *pev ;
  28. int        trigger ;
  29. {
  30.  
  31.     static char tptr[21];
  32.     char    t[35];
  33.     int     delay , komi_id, komi_number, hanmoku_id, vicdef_id, vicdef_number;
  34.     int        min, max, delta, ptColum ;
  35.     int        plitem, maxRow, maxColum, lastRow, lastColumn;
  36.     YMDHM    play_start, play_end;
  37.  
  38.     MMI_SendMessage( blacknameId, MM_GETTEXT, 3, tptr, 21, FALSE);
  39.     tptr[20] = '\0';
  40.     title_blacknameset( tptr);
  41.     
  42.     MMI_SendMessage( whitenameId, MM_GETTEXT, 3, tptr, 21, FALSE);
  43.     tptr[20] = '\0';
  44.     title_whitenameset( tptr);
  45.     
  46.     MMI_SendMessage( placeId, MM_GETTEXT, 3, tptr, 21, FALSE);
  47.     tptr[20] = '\0';
  48.     title_playspaceset( tptr);
  49.     
  50.     /*    数値入力パネルの読み取り    */
  51.     MMI_SendMessage(numboxId[0], MM_GETNUMBOX, 5,
  52.                             &delay, &min, &max, &delta, &ptColum) ;
  53.     play_start.year = delay;
  54.     MMI_SendMessage(numboxId[1], MM_GETNUMBOX, 5,
  55.                             &delay, &min, &max, &delta, &ptColum) ;
  56.     play_start.month = delay;
  57.     MMI_SendMessage(numboxId[2], MM_GETNUMBOX, 5,
  58.                             &delay, &min, &max, &delta, &ptColum) ;
  59.     play_start.day = delay;
  60.     MMI_SendMessage(numboxId[3], MM_GETNUMBOX, 5,
  61.                             &delay, &min, &max, &delta, &ptColum) ;
  62.     play_start.hour = delay;
  63.     MMI_SendMessage(numboxId[4], MM_GETNUMBOX, 5,
  64.                             &delay, &min, &max, &delta, &ptColum) ;
  65.     play_start.minute = delay;
  66.     title_playstart_time_set( play_start);
  67.     
  68.  
  69.     MMI_SendMessage(numboxId[5], MM_GETNUMBOX, 5,
  70.                             &delay, &min, &max, &delta, &ptColum) ;
  71.     play_end.year = delay;
  72.     MMI_SendMessage(numboxId[6], MM_GETNUMBOX, 5,
  73.                             &delay, &min, &max, &delta, &ptColum) ;
  74.     play_end.month = delay;
  75.     MMI_SendMessage(numboxId[7], MM_GETNUMBOX, 5,
  76.                             &delay, &min, &max, &delta, &ptColum) ;
  77.     play_end.day = delay;
  78.     MMI_SendMessage(numboxId[8], MM_GETNUMBOX, 5,
  79.                             &delay, &min, &max, &delta, &ptColum) ;
  80.     play_end.hour = delay;
  81.     MMI_SendMessage(numboxId[9], MM_GETNUMBOX, 5,
  82.                             &delay, &min, &max, &delta, &ptColum) ;
  83.     play_end.minute = delay;
  84.     title_playend_time_set( play_end);
  85.  
  86.     /*  コミの読み取り */
  87.     /*    リストメニューの読み取り    */
  88.     MMI_SendMessage(listMenuId[0], MM_GETLMENUPTR, 5, 
  89.                         &plitem, &maxRow, &maxColum, &lastRow, &lastColumn) ;
  90.     komi_id = lastRow;
  91.     MMI_SendMessage(numboxId[10], MM_GETNUMBOX, 5,
  92.                             &delay, &min, &max, &delta, &ptColum) ;
  93.     komi_number = delay;
  94.     MMI_SendMessage(listMenuId[1], MM_GETLMENUPTR, 5, 
  95.                         &plitem, &maxRow, &maxColum, &lastRow, &lastColumn) ;
  96.     hanmoku_id = lastRow;
  97.     title_komiset( komi_id, komi_number, hanmoku_id);
  98.  
  99.     /*  勝敗の読み取り */
  100.     /*    リストメニューの読み取り    */
  101.     MMI_SendMessage(listMenuId[2], MM_GETLMENUPTR, 5, 
  102.                         &plitem, &maxRow, &maxColum, &lastRow, &lastColumn) ;
  103.     switch(lastRow ){
  104.         case 0: 
  105.             vicdef_id=0;
  106.             MMI_SendMessage(numboxId[11], MM_GETNUMBOX, 5,
  107.                             &delay, &min, &max, &delta, &ptColum) ;
  108.             vicdef_number = delay;
  109.             break;
  110.         case 1:
  111.             vicdef_id=1;
  112.             MMI_SendMessage(numboxId[11], MM_GETNUMBOX, 5,
  113.                             &delay, &min, &max, &delta, &ptColum) ;
  114.             vicdef_number = delay;
  115.             break;
  116.         case 2:
  117.             vicdef_id=2;
  118.             vicdef_number=0;
  119.             break;
  120.         case 3:
  121.             vicdef_id=0;
  122.             vicdef_number=-1;
  123.             break;
  124.         case 4:
  125.             vicdef_id=1;
  126.             vicdef_number=-1;
  127.             break;
  128.         default:
  129.             break;
  130.     }
  131.     
  132.     title_issueset( vicdef_id, vicdef_number);
  133.     title_fsave_on();
  134.  
  135.     /*    リストメニューワークメモリの解放    */
  136.     MMI_SendMessage(listMenuId[0], MM_SETMAXROWCOLUM, 2, 0, 0) ;
  137.     MMI_SendMessage(listMenuId[1], MM_SETMAXROWCOLUM, 2, 0, 0) ;
  138.     MMI_SendMessage(listMenuId[2], MM_SETMAXROWCOLUM, 2, 0, 0) ;
  139.  
  140.     /*    dialogId_titleで示されるオブジェクトを消す        */
  141.     MMI_SendMessage( dialogId_title , MM_ERASE , 0 ) ;
  142.  
  143.     /*    オブジェクトをダイアログから取り外す    */
  144.     MMI_SendMessage( dialogId_title , MM_DETACH , 0 ) ;
  145.     /*  ダイアログを消した後でないと表示されないことがある */
  146.     title_dispFunc();
  147.     
  148.  
  149.     retunrInitMenuFunc();
  150.  
  151.     return NOERR ;
  152. }
  153.  
  154. /*    initDataMITITLE:dbId[1]:MJ_DBUTTONL40の呼び出し関数    */
  155. int    igo_titlecancel(kobj, messId, argc, pev, trigger)
  156. int        kobj ;
  157. int        messId ;
  158. int        argc ;
  159. EVENT    *pev ;
  160. int        trigger ;
  161. {
  162.     /*    dialogId_titleで示されるオブジェクトを消す        */
  163.     MMI_SendMessage( dialogId_title , MM_ERASE , 0 ) ;
  164.  
  165.     /*    オブジェクトをダイアログから取り外す    */
  166.     MMI_SendMessage( dialogId_title , MM_DETACH , 0 ) ;
  167.  
  168.     retunrInitMenuFunc();
  169.  
  170.     return NOERR ;
  171. }
  172.